package rui.game.component.function;

import lombok.Setter;
import rui.game.component.Count;
import rui.game.component.GameFrame;
import rui.game.component.GamePanel;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionListener;

/**
 * 重新开始
 *
 * @author 赵睿
 */

public class Restart extends JButton {


    public Restart() {
        super("重新开始");
        globalSettings();
    }

    public static Restart init(Restart restart, GameFrame gameFrame, ActionListener actionListener){
        if(restart==null){
            restart=new Restart();
            gameFrame.getContentPane().add(restart);
            restart.addActionListener(actionListener);
        }
        return restart;
    }

    protected void globalSettings() {
        this.setFont(new Font("楷体", Font.BOLD, 12));
        this.setBounds(54, 433, 93, 40);


    }

}
